﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage"  ContentType="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"  >
<head runat="server">
    <title>文件删除页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
    <div>
    <%    
 //if 判断条件中,第一个条件是为了防止没有权限的用户删除文件,可以根据需要修改.   
          try          
          {      
              string type=Request.QueryString["type"];  
              if(type.Equals("1"))         
                  System.IO.File.Delete(Server.MapPath(Request.QueryString["filePath"].Trim()));     
              else if(type.Equals("0"))
                  System.IO.File.Delete(Server.MapPath(Request.QueryString["filePath"].Trim()));  
             Response.Write("1");    
          }    
           catch     
           {
               Response.Write("0");   
           }
  %>

    </div>
</body>
</html>
